package org.example.controller;

import org.example.entry.Cat;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;

/**
 * Created with IntelliJ IDEA 2023.
 * Description:
 * User: homechen
 * Date: 2024-03-31
 * Time: 18:34
 */
@Controller
public class ScopeController2 {
    @Autowired
    @Qualifier(value = "cat1")
    private Cat cat2;

    public void doController() {
        System.out.println(cat2.toString());  // 想拿到原来的加菲猫   结果拿到了 改了名字的汤姆猫
    }
}
